package cloud.daodao.storm.common.security.api;

import cloud.daodao.storm.common.security.constant.SecurityConstant;
import cloud.daodao.storm.common.constant.AppConstant;
import cloud.daodao.storm.common.model.Request;
import cloud.daodao.storm.common.model.Response;
import cloud.daodao.storm.common.security.model.secret.*;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.service.annotation.HttpExchange;
import org.springframework.web.service.annotation.PostExchange;

/**
 * @author DaoDao
 */
@Tag(name = "SecretApi", description = "SecretApi")
@HttpExchange(url = AppConstant.API)
public interface SecretApi {

    @Operation(summary = "AES 查询", description = "@DaoDao 查询 AES 密钥")
    @PostExchange(url = SecurityConstant.AES_SELECT)
    Response<AesData> aesSelect(@RequestBody @Valid Request<AesSelect> request);

    @Operation(summary = "AES 写入", description = "@DaoDao 写入 AES 密钥")
    @PostExchange(url = SecurityConstant.AES_UPSERT)
    Response<AesData> aesUpsert(@RequestBody @Valid Request<AesUpsert> request);

    @Operation(summary = "RSA 查询", description = "@DaoDao 查询 RSA 密钥")
    @PostExchange(url = SecurityConstant.RSA_SELECT)
    Response<RsaData> rsaSelect(@RequestBody @Valid Request<RsaSelect> request);

    @Operation(summary = "RSA 写入", description = "@DaoDao 写入 RSA 密钥")
    @PostExchange(url = SecurityConstant.RSA_UPSERT)
    Response<RsaData> rsaUpsert(@RequestBody @Valid Request<RsaUpsert> request);

}
